from numpy.f2py.auxfuncs import l_not

x=1
y=x+1

if x<1:
    print(False)
elif y>1:
    print("xixi")
else:
    print(f"走else={x}")
def add(x=1):
    while x<5:
        x+=1
        r=range(3,9,1)
        print(f"循环中=={x}--{r}")

print(f"{add(2)}")
ls=["aa","bb"]
ls.append(2**2)
tp=(ls,1,{"ss":2})
tp2=("数组","数值","dic")
dic={"name":"zhangsan"}
aSet=set("xixi")
bSet=set(["a","b","c"])

ls=[1,3,4]
# 递推表达式,过滤掉4，再平方
ls2=[e**2 for e in ls if e!=4]
print("ls2:",ls2)

list=[{"name":"zhangsan","age":13},{"name":"lisi","age":10}]
list2=[e for e in list if e["age"]>10]
print("过滤掉：",list2)
# 拉链
for (k,v) in zip(tp,tp2):
    print(k,":",v)
for e in tp:
    print("for",e)

for (k,v) in dic.items():
    print(k,":",v)
print(f"{tp}--set={aSet}---{bSet}")

from typing import List, Optional, Dict, Any, Tuple


class Description():
    def __init__(self,api_key:str):
        self.api_key=api_key

    def ask(self, prompts: List[str],dic:Dict={},
        stop: Optional[List[str]] = None)->Tuple[int,str,bool]:
        print("切片：",prompts[:1])
        for e in prompts:
            print(e)
        for e in dic.items():
            print(e)
        for (i,e) in enumerate(prompts):# 变成tubue
            print(i,e)
        return (10,"22",True)

    def open_doc(self):
        fp="/Users/jiandian/PycharmProjects/PythonProject/numpy-test.py"
        with open(fp,"r") as f:
            while True:
                ln=f.readline()
                if ln=='':
                    break
                else:
                    print(ln)


deepseek_llm = Description(api_key="your-deepseek-api-key")
deepseek_llm.ask(["hello","word"],dic={"name":"zhangsan","age":19})

# deepseek_llm.open_doc()